import URL from '@/config/url'
import utils from '@/utils/utils'

export default {
	// 获取商品列表
	getGoodsList(params = {}) {
		let data = {
			keyword: params.keyword,
			price:params.price,
			volume:params.volume,
			page: params.page,
			pagesize: 10
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/shop/agent/product/list',
			data
		})
	},
	// 改价列表
	getChangePriceList(params = {}) {
		let data = {
			keyword: params.keyword,
			price: params.price,
			profit: params.profit,
			page: params.page,
			pagesize: 10
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/shop/agent/product/price_list',
			data
		})
	},
	// 商品详情
	GoodsDetaile(params = {}) {
		let data = {
			product_id: params.product_id
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/shop/agent/product/detail',
			data
		})
	},
	// 分销改价
	EditChangePrice(params = {}){
		let data = {
			product_id: params.product_id,
			product_skuid:params.product_skuid,
			agent_price:params.agent_price,
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/shop/agent/product/update/price',
			data
		})
	},
	// 分享
	GoodsShare(params = {}) {
		let data = {
			product_id: params.product_id,
			sku_id:params.sku_id
		}
		return utils.uniRequest({
			url: URL.BASE2 + '/shop/agent/product/share',
			data
		})
	},
	
	getBanner(params = {}) {
		let data = {
			type: params.type
		}
		return utils.uniRequest({
			url: URL.BASE + '/base/banner',
			data
		})
	},
}
